<script setup>
import { NNumberAnimation } from 'naive-ui'
import emitter from '@/utils/pubsub'

const { proxy } = getCurrentInstance()

function listenView() {
  proxy.$refs.yyxlRef?.play()
  proxy.$refs.khlxRef?.play()
  proxy.$refs.glcbRef?.play()
  proxy.$refs.khtsRef?.play()
}

onMounted(() => {
  emitter.on('observe-view', entry => {
    if (entry.target.id === 'assistanceRef') {
      listenView()
    }
  })
})
</script>

<template>
  <div>
    <section class="w-full">
      <h2 class="flex justify-center items-center font-bold">
        <span class="text-size-60px text-hex-0A87F8">10000+</span>
        <span class="leading-60px text-size-44px font-bold">企业都在使用寓盟管家</span>
      </h2>
      <div class="w-full relative h-490px overflow-hidden mt-81px">
        <img class="absolute left-0 h-full w-125px border-none z-10" src="/public/images/home/acide.png" />
        <img class="absolute right-0 h-full w-125px border-none z-10 transform rotate-180" src="/public/images/home/acide.png" />
        <div class="firms"></div>
      </div>
    </section>
    <section class="ym1000">
      <h2>
        <img class="w-702px h-72px" src="/public/images/home/yumeng1000.png" alt="寓盟管家助力10000+企业降本增效" />
      </h2>
      <div id="assistanceRef" class="flex w-1200px justify-between mt-40px observe-view">
        <div>
          <div class="flex items-center">
            <div class="text-size-60px font-bold leading-72px"><NNumberAnimation ref="yyxlRef" :duration="3500" :from="0" :to="70" />%</div>
            <img class="w-30px h-39px ml-15px ml-15px" src="/public/images/icon/up-arrow.png" alt="运营效率" />
          </div>
          <div class="text-hex-333 text-size-20px leading-28px mt-8px">运营效率</div>
        </div>
        <div>
          <div class="flex items-center">
            <div class="text-size-60px font-bold leading-72px"><NNumberAnimation ref="khlxRef" :duration="3500" :from="0" :to="30" />%</div>
            <img class="w-30px h-39px ml-15px ml-15px" src="/public/images/icon/up-arrow.png" alt="客户拉新留存" />
          </div>
          <div class="text-hex-333 text-size-20px leading-28px mt-8px">客户拉新留存</div>
        </div>
        <div>
          <div class="flex items-center">
            <div class="text-size-60px font-bold leading-72px"><NNumberAnimation ref="glcbRef" :duration="3500" :from="100" :to="50" />%</div>
            <img class="w-30px h-39px ml-15px ml-15px" src="/public/images/icon/down-arrow.png" alt="管理成本" />
          </div>
          <div class="text-hex-333 text-size-20px leading-28px mt-8px">管理成本</div>
        </div>
        <div>
          <div class="flex items-center">
            <div class="text-size-60px font-bold leading-72px"><NNumberAnimation ref="khtsRef" :duration="3500" :from="100" :to="35" />%</div>
            <img class="w-30px h-39px ml-15px ml-15px" src="/public/images/icon/down-arrow.png" alt="客户投诉" />
          </div>
          <div class="text-hex-333 text-size-20px leading-28px mt-8px">客户投诉</div>
        </div>
      </div>
      <div class="flex mt-40px">
        <NuxtLink class="w-172px h-56px full-btn text-size-20px rounded-lg leading-56px" to="https://saas.byteox.com/#/login">免费试用</NuxtLink>
        <NuxtLink class="w-172px h-56px white-btn text-size-20px rounded-lg leading-56px ml-30px">预约演示</NuxtLink>
      </div>
    </section>
    <footer class="w-full min-h-664px pt-60px bg-hex-1F2329">
      <div class="flex w-1200px justify-start items-start text-left pb-40px mx-auto" style="border-bottom: 1px solid rgba(255, 255, 255, 0.2)">
        <ul>
          <li class="li-title">产品</li>
          <li class="li-item mt-24px cursor-pointer hover:underline"><NuxtLink to="/product/product">寓盟管家</NuxtLink></li>
          <!-- TODO  推房助手 -->
          <li class="li-item mt-16px cursor-pointer hover:underline"><NuxtLink to="/product/tfzs">推房助手</NuxtLink></li>
          <li class="li-item mt-16px cursor-pointer hover:underline"><NuxtLink to="https://zufang.byteox.com/homepage">萌友租房</NuxtLink></li>
          <li class="li-item mt-16px cursor-pointer hover:underline">聚多房</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">AIoT平台</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">寓学社</li>
        </ul>
        <ul class="ml-112px">
          <li class="li-title">行业解决方案</li>
          <li class="li-item mt-24px cursor-pointer hover:underline">保租房</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">公租房</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">长租公寓</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">短租公寓</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">服务式公寓</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">人才公寓</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">学生公寓</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">宿舍</li>
        </ul>
        <ul class="ml-112px">
          <li class="li-title">服务支持</li>
          <li class="li-item mt-24px cursor-pointer hover:underline">在线客服</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">预约演示</li>
          <li class="li-item mt-16px cursor-pointer hover:underline">
            <NuxtLink to="/resourceServices/download">下载</NuxtLink>
          </li>
        </ul>
        <ul class="ml-112px">
          <li class="li-title">探索字节牛集团</li>
          <li class="li-item mt-24px cursor-pointer hover:underline">
            <NuxtLink to="/about">关于我们</NuxtLink>
          </li>
          <li class="li-item mt-16px cursor-pointer">资讯</li>
          <li class="li-item mt-16px cursor-pointer">上海总部：上海市奉贤区金海公路6055号</li>
          <li class="li-item mt-16px cursor-pointer">武汉总部：武汉市东湖高新区光谷中心城高新大道 776 号华翔中心</li>
          <li class="li-item mt-16px cursor-pointer">邮箱：business@byteox.com</li>
          <li class="li-item mt-16px cursor-pointer">联系电话：400-186-1216</li>
          <li class="li-item mt-16px cursor-pointer">
            <ul class="flex">
              <li>
                <img class="w-88px h-88px" alt="寓盟管家公众号" src="/public/images/footer/ymgj.png" />
                <p class="text-white text-size-12px text-center mt-8px">寓盟管家公众号</p>
              </li>
              <li class="ml-16px">
                <img class="w-88px h-88px" alt="萌友租房公众号" src="/public/images/footer/myzf.png" />
                <p class="text-white text-size-12px text-center mt-8px">萌友租房公众号</p>
              </li>
              <li class="ml-16px">
                <img class="w-88px h-88px" alt="推房助手公众号" src="/public/images/footer/tfzs.png" />
                <p class="text-white text-size-12px text-center mt-8px">推房助手公众号</p>
              </li>
              <li class="ml-16px">
                <img class="w-88px h-88px" alt="人民安居公众号" src="/public/images/footer/rmaj.png" />
                <p class="text-white text-size-12px text-center mt-8px">人民安居公众号</p>
              </li>
            </ul>
          </li>
        </ul>
      </div>
      <div class="w-1200px mt-40px mx-auto">
        <img class="w-785px h-33px" src="/public/images/footer/byteox.png" alt="字节牛集团" />
      </div>
      <p class="w-1200px text-size-12px text-white font-normal leading-4 mt-24px mx-auto"><span>©2024 - 字节牛-寓盟管家 版权所有</span> <span class="ml-10px">鄂ICP备19008529 号</span></p>
    </footer>
  </div>
</template>

<style scoped>
@keyframes firms-frames {
  0% {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translateX(-50%);
  }
}
.firms {
  width: 660vw;
  height: 100%;
  background: url(/public/images/footer/firms.png) 50% / contain repeat;
  animation-name: firms-frames;
  animation-duration: 50s;
  animation-play-state: running;
  animation-timing-function: linear;
  animation-delay: 0s;
  animation-iteration-count: infinite;
  animation-direction: normal;
  animation-fill-mode: none;
}
.ym1000 {
  background: url('/public/images/home/bg-111.png') 0 0 no-repeat;
  background-size: 100% 100%;
  padding-top: 70px;
  @apply flex flex-col items-center w-full h-450px px-48 mt-140px;
}
.li-title {
  @apply text-size-20px font-medium leading-28px text-white text-left;
}
.li-item {
  @apply text-white font-normal leading-20px text-left;
}
</style>
